import request from '@/utils/request'

export function memberList (parameter) {
  return request({
    url: '/boss/project/team/listTeam',
    method: 'post',
    data: parameter
  })
}
export function getMemberDetail (parameter) {
  return request({
    url: '/boss/project/team/teamDetail',
    method: 'post',
    data: parameter
  })
}
export function deleteMember (parameter) {
  return request({
    url: '/boss/project/team/deleteTeam',
    method: 'post',
    data: parameter
  })
}
export function deleteLeader (parameter) {
  return request({
    url: '/boss/project/team/deleteAdmin',
    method: 'post',
    data: parameter
  })
}
export function centerList (parameter) {
  return request({
    url: '/boss/project/manage/listResearch',
    method: 'post',
    data: parameter
  })
}
export function addCenter (parameter) {
  return request({
    url: '/boss/project/team/research/add',
    method: 'post',
    data: parameter
  })
}
export function deleteCenter (parameter) {
  return request({
    url: '/boss/project/team/research/delete',
    method: 'post',
    data: parameter
  })
}
export function getRolesList (parameter) {
  return request({
    url: '/boss/system/role/list',
    method: 'post',
    data: parameter
  })
}
export function getNewRolesList (parameter) {
  return request({
    url: '/common/listRole',
    method: 'post',
    data: parameter
  })
}
export function centerMemberList (parameter) {
  return request({
    url: '/boss/project/team/research/listMember',
    method: 'post',
    data: parameter
  })
}
export function addCenterMember (parameter) {
  return request({
    url: '/boss/project/team/research/addMember',
    method: 'post',
    data: parameter
  })
}
export function deleteCenterMember (parameter) {
  return request({
    url: '/boss/project/team/research/deleteMember',
    method: 'post',
    data: parameter
  })
}
export function updateCenterMember (parameter) {
  return request({
    url: '/boss/project/team/research/updateMember',
    method: 'post',
    data: parameter
  })
}
export function updateMainRes (parameter) {
  return request({
    url: '/boss/project/team/updateMainRes',
    method: 'post',
    data: parameter
  })
}
export function getCenterDetail (parameter) {
  return request({
    url: '/boss/project/team/research/detail',
    method: 'post',
    data: parameter
  })
}
export function updateCenter (parameter) {
  return request({
    url: '/boss/project/team/research/update',
    method: 'post',
    data: parameter
  })
}
export function updateApprover (parameter) {
  return request({
    url: '/boss/project/team/updateIsCheck',
    method: 'post',
    data: parameter
  })
}
export function reinviteMember (parameter) {
  return request({
    url: '/boss/project/team/anewInviteTeam',
    method: 'post',
    data: parameter
  })
}
export function reinviteCenterMember (parameter) {
  return request({
    url: '/boss/project/team/research/anewInviteRes',
    method: 'post',
    data: parameter
  })
}
export function getListCrc (parameter) {
  return request({
    url: '/boss/project/team/listCrc',
    method: 'post',
    data: parameter
  })
}
export function getListCra (parameter) {
  return request({
    url: '/boss/project/team/listCra',
    method: 'post',
    data: parameter
  })
}
export function getContractCenter (parameter) {
  return request({
    url: '/boss/project/manage/listContractByRes',
    method: 'post',
    data: parameter
  })
}
export function getResearchDetail (parameter) {
  return request({
    url: '/boss/project/team/research/detail/getById',
    method: 'post',
    data: parameter
  })
}
export function getListPI (parameter) {
  return request({
    url: '/boss/project/team/listPi',
    method: 'post',
    data: parameter
  })
}
export function modityRecode (parameter) {
  return request({
    url: '/boss/project/team/modityRecode',
    method: 'get',
    params: parameter
  })
}
export function allTeam (parameter) {
  return request({
    url: '/boss/project/team//allTeam',
    method: 'get',
    params: parameter
  })
}
export function activityExport (parameter) {
  return request({
    url: '/boss/project/team/activityExport',
    method: 'get',
    params: parameter,
    responseType: 'blob'
  })
}
export function activityRecode (parameter) {
  return request({
    url: '/boss/project/team/activityRecode',
    method: 'get',
    params: parameter
  })
}
export function statusTeam (parameter) {
  return request({
    url: '/boss/project/team/statusTeam',
    method: 'post',
    data: parameter
  })
}
export function teamResearch (parameter) {
  return request({
    url: '/boss/project/team/teamResearch',
    method: 'post',
    data: parameter
  })
}
export function researchIds (parameter) {
  return request({
    url: '/boss/project/team/researchIds',
    method: 'get',
    params: parameter
  })
}
export function anewInviteRes (parameter) {
  return request({
    url: '/boss/project/team/research/anewInviteRes',
    method: 'post',
    data: parameter
  })
}
export function cancelInviteRes (parameter) {
  return request({
    url: '/boss/project/team/research/cancelInviteRes',
    method: 'post',
    data: parameter
  })
}

/**
 * 获取研究者邀请记录
 * @param parameter
 * @return {*}
 */
export function apiGetPIInvitedRecord (parameter) {
  return request({
    url: '/boss/project/invited_record/listForPI',
    method: 'get',
    params: parameter
  })
}


export function apiCenterActive (parameter) {
  return request({
    url: '/boss/project/manage/operate',
    method: 'post',
    data: parameter
  })
}
// 权限移交
export function transfer (parameter) {
  return request({
    url: 'boss/project/info/transfer',
    method: 'post',
    data: parameter,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}
